/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pl.put.dcs_modeler.utils;


import org.apache.log4j.Logger;
import org.netbeans.api.project.Project;
import org.netbeans.api.project.ProjectInformation;
import org.netbeans.api.project.ProjectUtils;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.Repository;
/**
 *
 * @author LukaszR
 */
public class FlowModelUtil
{
    public static Logger log = Logger.getLogger( FlowModelUtil.class.getName() );

    public static String getSerializedFlowModelPath( Project project )
    {
        FileObject projectRsrc = Repository.getDefault().getDefaultFileSystem().findResource( "Templates/Project/DCS/DCS Project" );
        String defaultProjectPkg = ( String )projectRsrc.getAttribute( "defaultProjectSrcPackage" );
        ProjectInformation projectInfo = ProjectUtils.getInformation( project );
        String projectName = projectInfo.getName();
        FileObject temp = Repository.getDefault().getDefaultFileSystem().findResource( "Templates/DCS/DCSComputingModel.dcsmodel" );
        String pathToModel = "src/" + defaultProjectPkg + "/" + projectName + "/" + ( String )temp.getAttribute( "pathToModel" ) ;
        return pathToModel;
    }
}
